﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace 站点地图设计_面包屑
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            //参数多的路由写在前面
            //有约束的路由写在前面

            routes.MapRoute(
                name: "list",
                url: "{controller}/{action}/{category}-{minprice}-{maxprice}-{sort}-{page}",
                defaults: new { controller = "Home", action = "Index" }
                );

            routes.MapRoute(
                 name: "indexlist",
                 url: "{controller}/{action}/{id}-{page}",
                 defaults: new { controller = "Home", action = "Index" }
                // constraints: new { controller = "UserCenter" }
                );

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
        }
    }
}